package com.hrsaas.ext.spider.test.mybatis.model;

import java.io.Serializable;
import java.util.Date;

/**
 * @author wangxiaoliang
 *
 */
public class ResumeSpider implements Serializable {

	private static final long serialVersionUID = -7201144127196765884L;

	private Long id;
	
	private String username;
	
	private String password;
	
	private String encryptPassword;
	
	private Integer channel;
	
	private Integer yn;
	
	private String phone;
	
	private String cookies;
	
	private String headers;
	
	private Integer collections;
	
	private Date createTime;
	
	private Date updateTime;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEncryptPassword() {
		return encryptPassword;
	}

	public void setEncryptPassword(String encryptPassword) {
		this.encryptPassword = encryptPassword;
	}

	public Integer getChannel() {
		return channel;
	}

	public void setChannel(Integer channel) {
		this.channel = channel;
	}

	public Integer getYn() {
		return yn;
	}

	public void setYn(Integer yn) {
		this.yn = yn;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getCookies() {
		return cookies;
	}

	public void setCookies(String cookies) {
		this.cookies = cookies;
	}

	public String getHeaders() {
		return headers;
	}

	public void setHeaders(String headers) {
		this.headers = headers;
	}

	public Integer getCollections() {
		return collections;
	}

	public void setCollections(Integer collections) {
		this.collections = collections;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Override
	public String toString() {
		return "ResumeSpider [id=" + id + ", username=" + username + ", password=" + password + ", encryptPassword="
				+ encryptPassword + ", channel=" + channel + ", yn=" + yn + ", phone=" + phone + ", cookies=" + cookies
				+ ", headers=" + headers + ", collections=" + collections + ", createTime=" + createTime
				+ ", updateTime=" + updateTime + "]";
	}

	public enum Channel {
		
		LAGOU(1,"lagou")
		;
		
		private Integer code;
		private String name;

		private Channel(Integer code, String name) {
			this.code = code;
			this.name = name;
		}
		
		public Integer getCode() {
			return this.code;
		}
		
		public String getName() {
			return this.name;
		}
		
		public static Channel getChannel(String name) {
			if (name == null) return null;
			for (Channel c : values()) {
				if (c.getName().equalsIgnoreCase(name))
					return c;
			}
			return null;
		}
		
		public static Channel getChannel(Integer code) {
			if (code == null) return null;
			for (Channel c : values()) {
				if (c.getCode().intValue() == code.intValue())
					return c;
			}
			return null;
		}
	}
	
}
